package ink.lovejinhu.leetcode;

/**
 * @Author: jin
 * @Date: 2021/9/6 16:27
 * @Version: V1.0
 * @Slogan: Great people are not born great, but show their greatness in the process of growing up
 **/
public class Solution_0852 {
    /**
     * @param arr
     * @return
     */
    public int peakIndexInMountainArray(int[] arr) {
        boolean flag = false;
        for (int i = 1; i < arr.length; i++) {
            if (arr[i - 1] < arr[i]) {
                continue;
            } else {
                return i-1;
            }
        }
        return 0;
    }
}
